/*
 * @Descripttion:
 * @version:
 * @Author: chenbolin@msn.cn
 * @Date: 2021-05-20 10:35:50
 * @LastEditors: chenbolin@msn.cn
 * @LastEditTime: 2023-10-18 09:49:09
 */
#ifndef HAL_COMMON_H
#define HAL_COMMON_H

#include "HalCtype.h"

#include "HalUart.h"
#include "HalGPIO.h"
#include "HalDAC.h"
#include "HalPWM.h"
#include "HalFlash.h"

typedef enum
{
    HAL_LED_STATUS_NORMAL = 0,
    HAL_LED_STATUS_HALT,
    HAL_LED_STATUS_UNAUTHORIZED,
} HalLEDStatus_t;

int HalGetUUID(uint8_t *idBuff);
void HalWaitMs(uint32_t ms);
uint32_t HalGetTicks(void);
void HalInterruptSet(bool enable);
void HalLEDSet(HalLEDStatus_t status);
void HalFeedDog(void);
void HalReboot(void);
void HalInitialize(void);
void HalPoll(void);

#define HalTimeHasPast(old, past) (HalGetTicks() - (old)) > (past)
#endif
